﻿import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQml 2.15
import Qt.labs.platform 1.1
import FluentUI 1.0

FluScrollablePage{
    launchMode:FluPageType.SingleInstance
    FluFrame{
        Layout.fillWidth: true
        Layout.topMargin: 20
        Layout.preferredHeight: 100
        padding: 10
        FluContentDialog{
            FluContentDialog{
                id: dialog_restart
                title: qsTr("提示")
                message: qsTr("此操作需要重启是否重新启动?")
                buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
                negativeText: qsTr("取消")
                positiveText: qsTr("确定")
                onPositiveClicked: {
                    FluRouter.exit(931)
                }
            }
        }
        ColumnLayout{
            spacing: 5
            anchors{
                top: parent.top
                left: parent.left
            }
            FluText{
                text: qsTr("夜间模式")
                font: FluTextStyle.BodyStrong
                Layout.bottomMargin: 4
            }
            FluRadioButtons {
                spacing: 10
                disabled: true
                manuallyDisabled: true
                FluRadioButton {
                    text: qsTr("浅色")
                    onClicked:{
                        SettingsHelper.saveDarkMode(1)
                        FluTheme.darkMode = FluThemeType.Light
                    }
                }
                FluRadioButton {
                    text: qsTr("深色")
                    onClicked: {
                        SettingsHelper.saveDarkMode(2)
                        FluTheme.darkMode = FluThemeType.Dark
                    }
                }
                Component.onCompleted: {
                  var mode =  SettingsHelper.getDarkMode()
                  if(mode === 0){
                      currentIndex = 0;
                  }
                  else{
                      currentIndex = 1;
                  }
                }
            }
        }
    }
    FluFrame{
        Layout.fillWidth: true
        Layout.preferredHeight: 130
        padding: 10

        ColumnLayout{
            spacing: 5
            anchors{
                top: parent.top
                left: parent.left
            }
            FluText{
                text: qsTr("视图模式")
                font: FluTextStyle.BodyStrong
                Layout.bottomMargin: 4
            }
            FluRadioButtons {
                spacing: 10
                disabled: true
                manuallyDisabled: true
                FluRadioButton {
                    text: qsTr("标准")
                    onClicked: {
                        SettingsHelper.saveNavigationViewMode(0)
                       // Global.displayMode = 0
                        FluTheme.nativeViewType = FluNavigationViewType.Open
                    }
                }
                FluRadioButton {
                    text: qsTr("紧凑")
                    onClicked: {
                        SettingsHelper.saveNavigationViewMode(1)
                        FluTheme.nativeViewType = FluNavigationViewType.Compact
                    }
                }
                FluRadioButton {
                    text: qsTr("极简")
                    onClicked: {
                        SettingsHelper.saveNavigationViewMode(2)
                        FluTheme.nativeViewType = FluNavigationViewType.Minimal

                    }
                }
                Component.onCompleted: {
                  var mode =  SettingsHelper.getNavigationViewMode()
                   currentIndex = mode;
                }
            }
        }
    }
    FluFrame{
        Layout.fillWidth: true
        Layout.preferredHeight: 100
        padding: 10
        ColumnLayout{
            spacing: 5
            anchors{
                top: parent.top
                left: parent.left
            }
            FluText{
                text: qsTr("语言")
                font: FluTextStyle.BodyStrong
                Layout.bottomMargin: 4
            }
            FluRadioButtons {
                spacing: 10
                disabled: true // 禁用所有FluRadioButton子组件
                manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
                FluRadioButton { text: qsTr("中文") }
                FluRadioButton { text: qsTr("英文") }
//                Component.completed: {

//                }
            }
        }

    }
}

